'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE, DECIMAL } = app.Sequelize;

  const Storegoods = app.model.define('store_good', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    stype: { type: STRING(1), comment: '入库或出库' },
    goods_id: { type: STRING(36) },
    sku: { type: STRING(255), comment: '商品SKU' },
    materialsCode: { type: STRING(255), comment: '商品料件号', field: 'materialsCode' },
    place: { type: STRING(50), comment: '库位' },
    batch: { type: STRING(30), comment: '批号' },
    count: { type: DECIMAL(11, 2), comment: '申报数量' },
    unit: { type: STRING(30), comment: '申报单位' },
    price: { type: DECIMAL(16, 2), comment: '申报价格' },
    currency: STRING(10),
    description: STRING(200),
    status: STRING(10),
    created_at: DATE,
    updated_at: DATE,
  });

  return Storegoods;
};
